<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>增加员工</title>
		<link href="css/bootstrap.css" rel="stylesheet">
	</head>

	<body>
		<article>

			<header class="container-fluid">
				<ul class="breadcrumb">
					<li>
						<a href="/view/index.html">首页</a> <span class="divider">/</span>
					</li>
					<li class="active">系统管理<span class="divider">/</span>
					</li>
					<li>
						<a href="staff.html">工作人员管理</a>
						<span class="divider">/</span></li>
					<li class="active">添加角色</li>
				</ul>
			</header>

			<form class="form-horizontal" @submit.prevent="submit">

				<div class="control-group">
					<label class="control-label">员工编号</label>
					<div class="controls">
						<input type="text" v-model="params.no" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">职称</label>
					<div class="controls">
						<input type="text" v-model="params.title" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">详情</label>
					<div class="controls">
						<input type="text" v-model="params.introUrl" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">性别</label>
					<div class="controls">
						<input type="text" v-model="params.male" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">工作电话</label>
					<div class="controls">
						<input type="text" v-model="params.workPhone" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">私人电话</label>
					<div class="controls">
						<input type="text" v-model="params.privatePhone" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">入职时间</label>
					<div class="controls">
						<input type="text" v-model="params.employedDate" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">电子邮箱</label>
					<div class="controls">
						<input type="text" v-model="params.email" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">微信</label>
					<div class="controls">
						<input type="text" v-model="params.wechat" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">家庭地址</label>
					<div class="controls">
						<input type="text" v-model="params.address" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">照片</label>
					<div class="controls">
						<input type="text" v-model="params.image" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">身份证号</label>
					<div class="controls">
						<input type="text" v-model="params.idCard" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">出生日期</label>
					<div class="controls">
						<input type="text" v-model="params.birthday" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">名字</label>
					<div class="controls">
						<input type="text" v-model="params.name" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">账户号码</label>
					<div class="controls">
						<input type="text" v-model="params.account" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">工种</label>
					<div class="controls">
						<input type="text" v-model="params.role" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label">创建人id</label>
					<div class="controls">
						<input type="text" v-model="params.createUserId" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label" for="inputRemark">备注</label>
					<div class="controls">
						<textarea rows="10" cols="20" v-model="params.remark"></textarea>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<button type="submit" class="btn btn-primary">新增</button>
						<a href="staff.html">返回</a>
					</div>
				</div>
			</form>

		</article>
		<script src="js/axios.js"></script>
		<script src="js/yi.toast.js"></script>
		<script src="js/vue.js"></script>
		<script src="js/bootstrap.js">
		const app=new Vue({
			el:"body>article",
			data:{
				params:{}
			},
			methods:{
				submit:function(){
					axios.post("http://127.0.0.1:8080/api/staff",this.params)
					.then(resp=>{
						if(resp.status ===200){
							toast("添加成功，请返回");
						}else{
							toast("失败了");
							toast(resp.message)
							console.log(resp)
						}
					});
				}
			}
			
		});
		</script>
	</body>

</html>